<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:doc="livcos.org/ns/doc"
	xmlns:j="livcos.org/ns/doc/journal"
	xmlns="http://www.w3.org/1999/XSL/Format"
	exclude-result-prefixes="doc j xs">
	
	<xsl:import href="outline.xsl"/>
	
	<xsl:template match="j:journal">
		<block xsl:use-attribute-sets="heading" id="{@id}">
			<xsl:call-template name="set-heading-attributes">
				<xsl:with-param name="level" select="count(ancestor::doc:chapter) + 1"/>
			</xsl:call-template>
			<xsl:number level="multiple" count="doc:chapter" format="1.1"/>
			<xsl:text> </xsl:text>
			<xsl:apply-templates select="j:title/node()"/>
		</block>
		<xsl:apply-templates select="j:entry">
			<xsl:sort select="@time" order="descending"/>
		</xsl:apply-templates>
	</xsl:template>
	
	<xsl:template match="j:entry">
		<block margin-left="6mm" margin-top="4pt" margin-right="4mm" margin-bottom="4pt">
			<inline font-size="60%" color="#006600" baseline-shift="3pt">
				<xsl:value-of select="format-dateTime(xs:dateTime(@time), '[D].[M].[Y] [H01]:[m01]')" />
			</inline>
			<xsl:text> </xsl:text>
			<xsl:apply-templates select="node()"/>
		</block>
	</xsl:template>
	
</xsl:stylesheet>
